﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FreeSqlDemo.Utils
{
    public class FreeSqlUtil
    {
        #region CreateFreeSqlClient
        public static IFreeSql CreateFreeSqlClient()
        {
            IFreeSql db = new FreeSql.FreeSqlBuilder()
                .UseConnectionString(FreeSql.DataType.MySql, @"Data Source=localhost;Port=3306;User ID=root;Password=123456;Initial Catalog=freesql_test;Charset=utf8mb4;SslMode=none;Allow User Variables=True;")
                .UseNoneCommandParameter(false)
                .Build(); //请务必定义成 Singleton 单例模式

            return db;
        }
        #endregion

    }
}
